<% layout('/layouts/default.html', {title: '出入库单管理', libs: ['validate','dataGrid']}){ %>
<script src="https://cdn.bootcdn.net/ajax/libs/bignumber.js/9.0.1/bignumber.js"></script>
<div class="main-content">
	<table id="dataGrid"></table>
</div>
<% } %>
<script>
	var data=${list};
	// console.log(${list})
	$('#dataGrid').dataGrid({
		// searchForm: $("#searchForm"),
		data,
		datatype: "local",
		columnModel: [
			{header: '主键', name: 'id', editable: true, hidden: true},
			{header: '主键', name: 'sort', editable: true, hidden: true},
			{header: '${text("物料名称")}', name: 'materialName', index: 'a.tally_date', width: 150, align: "center"},
			{header: '${text("已选数量")}', name: 'number', index: 'a.dept_code', width: 150, align: "left"},
		],
		// 加载成功后执行事件
		ajaxSuccess: function (data) {

		}
	});
	function commit() {
		var rowId = $('#dataGrid').dataGrid('getSelectRow');
		for (var i = 0; i < data.length; i++) {
			var item = data[i];
			if (rowId == item.id) return item;
		}
	}
</script>